	<div id="totalheight" alt="0"></div>
        <div class='am-text-center am-margin-vertical-sm am-text-sm am-text-danger loading'></div>
		  <!-- 全部推荐商品结束 -->
        <ul class="am-pagination am-pagination-centered am-text-xs" id="page" style="margin: 1rem 0 0 0;">
           {$page}      
		</ul>
        <div style="" class="am-text-xs am-text-center am-margin-vertical-sm">
            {:C('itk_site_name')} ©版权所有
		</div>

        </div>   
        <div data-am-widget="gotop" class="am-gotop am-gotop-fixed">
            <a class="fq-top">
                <i class="am-gotop-icon am-icon-chevron-up am-round"></i>
            </a>
        </div>
    <div class="menu">
        <ul class="am-avg-sm-3 am-text-center am-padding-top-xs">
            <li class="am-vertical-align">
                <a href="{:C('itk_wap_url')}">
                    <img src="__STATIC__/itaoke/mobile/images/personal/home-page-<if condition="$foot_curr eq 'index'">act<else/>unact</if>.png" class="am-text-center am-vertical-align-middle"/>
                    <br />               
                    <span class="am-text-center am-vertical-align-middle">首页</span>
                </a>
            </li>
            <li  class="am-vertical-align">
                <a href="{:U('Share/index')}">
                    <img src="__STATIC__/itaoke/mobile/images/personal/Inordertoshare-<if condition="$foot_curr eq 'share'">act<else/>unact</if>.png" class="am-text-center am-vertical-align-middle" />
                    <br />
                    <span class="am-text-center am-vertical-align-middle">晒单广场</span>
                </a>
            </li>
            <li  class="am-vertical-align">
                <a href="{:U('User/index')}">
                    <img src="__STATIC__/itaoke/mobile/images/personal/per-center-<if condition="$foot_curr eq 'user'">act<else/>unact</if>.png" class="am-text-center am-vertical-align-middle" />
                    <br />
                    <span class="am-text-center am-vertical-align-middle">个人中心</span>
                </a>
            </li>
        </ul>
    </div>
	<style>
		.main{
			bottom:40px;
		}
	</style>
<style>
.menu{
        width:100%;
        position:absolute;
        position:fixed;

        bottom:0;
        background:#fff;
        border-top:.1rem solid #F3E7E3;
        z-index:999;
    }
    .menu img {
        width:1.5rem;
        height:1.5rem;
        margin-bottom:.2rem;
    }
    .menu a {
        display:inline-block;
        color:#3d0505;

    }
    .menu a span {
        font-size:1.2rem;
    }
</style>
        <div class="am-modal am-modal-no-btn" tabindex="-1" id="qrcode_large">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">
                    <span class="am-text-sm">↓点击二维码放大后长按关注↓</span>
                    <a href="javascript: void(0)" class="am-close" style="top: -5px; right: 0px;" data-am-modal-close>&times;</a>
                </div>
                <div class="am-g">
                    <figure data-am-widget="figure" class="am am-figure" data-am-figure="{pureview:'true'}">
                    <div class="am-u-sm-6">
                    <img id="qrcode_img_large" src="{:C('itk_site_weixin')}" data-rel="{:C('itk_site_weixin')}" style="width:100%;">
                    <span class="am-text-xs am-text-danger" style="top: -2px;position: relative;">关注公众号</span>
                </div>
                <div class="am-u-sm-6">
                        <img id="qrcode_img_large" src="{:C('itk_site_wxkefu')}" data-rel="{:C('itk_site_wxkefu')}" style="width:100%;">
                        <span class="am-text-xs am-text-danger" style="top: -2px;position: relative;">客服微信</span>
                    </div>
                </figure>
            </div>
        </div>
		</div>
<script>
    $(".fq-classify").click(function () {
        //激活状态
        $(".fq-classify").addClass("active");
        $("#all_list").attr("class","am-block fq-classify active");
        $(".fq-classify").css("color","#f54d23");
        $(".column_list a").removeClass("active");
        
        //分类展示
        $(".fq-type").slideToggle();
    });
    //平滑滚动回顶部
    //console.log($('.main').scrollTop());
    $('.main').on('scroll',function(){
        $('.am-gotop-fixed').css('display','block');
        if ($('.main').scrollTop() === 0) {
            // 滚动到底部了
            $('.am-gotop-fixed').css('display','none');
        }
    });
    $('.fq-top').click(function(){
        $('.main').animate({
            scrollTop:$('.header_content').offset().top}, 800);
    });
</script>
<script type="text/javascript">
  if("1"==1){
      var zP = {$p};  //当前第几页
      var a = true;
      var tp={$tp};
      var pages=1;
  //    var id={$id};
  
      $(document).ready(function(e) { 
       $("#totalheight").attr("alt",0).show(); //定义一个总的高度变量
       if(window.location.href.indexOf('#load') != -1){
	 		  var top = /[\#]load=(\d+)/.exec(window.location)[1];
	          var p = /[\#]p=(\d+)/.exec(window.location)[1]; 	  
	          zP=p;
	          if(top!=''&& p!=''){
	           for(var i=1;i<=p;i++){
	             Productdata(i,top);
	           }
	          }
        }else{
              Productdata(zP,0);
        }
      });
        //自动加载设置
        $(".main").scroll(function(){  
          var totalheight = parseInt($("#totalheight").attr("alt"));
	        if ($(".main").scrollTop() >= totalheight){
	            if(pages>zP && a==true){
	              zP++;
	              a = false;
	              Productdata(zP,0);
	            }
	          } 
        });
         function Productdata(page,load){
           var key = "{$k}";
           var sort= "{$sort}";
           var ems='';
           var cid={$cid};
           var price={$price};
           var url = WAPURL+'/index.php?c=index&a=index&p='+page;
           if(sort !=""){
             url += '&sort='+sort;
           }
           if(key !=""){
              url += '&k='+ key;
           }
           if(cid!=0){
          	 url += '&cid='+ cid;
           }
           if(price!=0){
            url+='&price='+price;
           }
     //      if(id!=0){
     //        url+='&id='+id;
     //      }
           $.get(url,function(datation){
            if(pages==1)
            	pages=datation.data.pages;
             var data = datation.data.list;
             var scheight = parseInt($("#totalheight").attr("alt"));
              if(data != "null"){            
              var vLen = data.length;         
              if(page==1) $(".item_list").html(null);      
              for(var K=0;K<vLen;K++){
                var obj = data[K];
                var str = '';             
                str +='<div class="fq-background-white am-margin-top">';
                str +='<div class="am-padding-xs">';
                str +='<div class="am-inline-block" style="width:40%">';
                str +='<a  href="javascript:void(0);" data-url="'+obj.url+'" data-id="'+obj.id+'" data-p="'+page+'" data-search="'+key+'" class="tobuy">';
                str += '<img src="'+obj.pic_url+'" class="fq-image">';
                str += '</a>';
                str +='</div>';
                str +='<ul class="am-avg-sm-2 am-fr" style="width:60%; height:124px;">';
                str +='<li class="am-padding-horizontal-xs" style="border-right:.1rem dashed #eeeeee">';
                str +='<strong id="item_details" data-id="'+obj.id+'" class="line-clamp am-text-sm">'+obj.title+'</strong>';
                str +='<div class="am-text-xs fq-color-gray" style="text-decoration:line-through">在售价'+obj.coupon_price+'</div>';
                str +='<div class="fq-color-danger">';
                str +='<span class="am-text-xs">券后</span>';
                if(obj.quan!=0){
                   str +='<strong class="am-text-lg price">'+ obj.after_price +'</strong>';
                }else{
                   str +='<strong class="am-text-lg price">'+obj.coupon_price+'</strong>';
                }
                str +='</div>';
				if(obj.ems=1)
					ems= '包邮';
				else
					ems='';
                str +='<div><span class="am-text-xs fq-free fq-text-white am-radius">'+ems+'</span></div>';
                str +='<div class="am-text-xs fq-color-gray">销量'+obj.volume+'</div>';
                str +='</li>';
                str +='<li class="am-text-center">';
                str +='<div class="am-vertical-align-middle " style="line-height:1.2">';
                str +='<div class="am-round first-found am-inline-block am-text-center"></div>';
                str +='<div>';
                str +='<span class="am-text-sm fq-color-danger">￥</span>';
                if(obj.quan!=0 && obj.quan!= null){
                   str +='<span class="am-text-xl fq-color-danger">'+obj.quan+'</span>';
                }else{
                  str +='<span class="am-text-xl fq-color-danger">0</span>';
                }
                str +='</div>';
                str +='<span class="am-text-xs" style="color:rgba(0,0,0,0.5);">优惠券</span>';
                str +='<br />';
                if(obj.quan!=0){
                str +='<a href="javascript:void(0);" data-url="'+obj.url+'" data-id="'+obj.id+'" data-p="'+page+'" data-search="'+key+'" class="tobuy am-text-sm fq-text-white fq-background-red am-raduis am-block am-padding-xs am-margin-top-sm fq-a-focus">领券购买</a>';
                }else{
                   str +='<a href="javascript:void(0);" data-url="'+obj.url+'" data-id="'+obj.id+'" data-p="'+page+'" data-search="'+key+'" class="tobuy am-text-sm fq-text-white fq-background-red am-raduis am-block am-padding-xs am-margin-top-sm fq-a-focus">去购买</a>';
                }
                str +='<div class="am-round second-found am-inline-block am-text-center"></div></div></li></ul></div></div>';

                $(".item_list").append(str);
                scheight = scheight + 120;      
              }   
			  if(tp<=zP){
                 $(".loading").html('<span class="am-text-sm am-text-danger"><i class="am-icon-hand-o-up am-margin-right-xs"></i>不要再拉啦，已经没有啦</span>');
              }else{
                 $(".loading").html('<span class="am-text-sm am-text-success"><i class="am-icon-spinner am-icon-pulse am-margin-right-xs"></i>商品正在赶来的路上，请稍后</span>');
              }
			  $('#page').html(datation.data.page);  
              }else{  
                   if(page==1) $(".item_list").html('<p style="text-align:center;width:100%;display:block;">暂无商品....</p>');
             }
             if(load!=0)
             	$('.main').scrollTop(load);
            //加载成功后要修改totalheight的高度
            $("#totalheight").attr("alt",scheight).hide();
            a = true;
          });
          
        }
 }
    function search(){
        $("#search").submit();
    }
	$(document).on('click','.tobuy',function(){
		var url= $(this).attr('data-url');
		var p=$(this).attr('data-p');
           var key = "{$k}";
           var sort= "{$sort}";
           var ems='';
           var cid={$cid};
           var price={$price};
           var l_url = WAPURL+'/index.php?c=index&a=index';
           if(sort !=""){
             l_url += '&sort='+sort;
           }
           if(key !=""){
              l_url += '&k='+ key;
           }
           if(cid!=0){
          	 l_url += '&cid='+ cid;
           }
           if(price!=0){
            l_url+='&price='+price;
           }
		l_url += '#load='+$('.main').scrollTop()+'#p='+p;
		window.history.replaceState({},'',l_url);
        window.location.href=url;
	});
</script>
<div class="am-hide">{:C('itk_statistics_code')}</div>